/////////////////////////////////////////////////////////////////////////////// 
//// FileName: iPN_Common.h
//// Description: header of common routines
//// Author: Charlie Chang (sengfu@gmail.com)
//// All right reserved 2014.
////  Revision History:
////      Create Date: 2014/09/10
////      
////////////////////////////////////////////////////////////////////////////////
#ifndef __INCLUDE_iPN_COMMON_H__
#define __INCLUDE_iPN_COMMON_H__

#include "iPN_Type.h"

#ifdef __cplusplus
extern "C" {
#endif

// Mutexs 
#if defined WIN32DLL
void MUTEX_LOCK(HANDLE *theMutex);
void MUTEX_RELEASE(HANDLE *theMutex);
#elif defined LINUX
#define 	MUTEX_LOCK(x) 		pthread_mutex_lock(x)
#define 	MUTEX_RELEASE(x)	pthread_mutex_unlock(x)
#endif  //// for Mutex

// time string convert
CHAR* FormatTime(time_t t, CHAR* ReturnString, UINT32 Size);

// mini second sleep
void __mSecSleep(UINT32 ms);

// DB Functions
INT32 RunDB_Connect();

#ifdef __cplusplus
}
#endif

#endif  //#ifndef __INCLUDE_iPN_COMMON_H__

